<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>商品详情</title>
		<link rel="icon" href="${project_name}/image/logo.png" >
		<link rel="stylesheet" type="text/css" href="${project_name}/css/head.css" />
		<link rel="stylesheet" type="text/css" href="${project_name}/css/footer.css" />
		<link rel="stylesheet" type="text/css" href="${project_name}/css/iemt.css" />



		<script src="${project_name}/js/jquery-1.8.3.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
		    $(function(){
		    	//添加一个点击事件
		    	$(".color_ul li").click(function(){
		    		//切换颜色
		    		$(this).addClass("on").siblings().removeClass("on");
		    	});
		    	//添加商品数量
		    	$(".wrap_input .btn-add").click(function(){
		    		//获得input值
		    		var y = $("#buy_num").val();
		    		//转整
		    		x = parseInt(y)+1;
		    		$("#buy_num").val(x); 
		    		
		    	});
		    	//添加商品数量
		    	$(".wrap_input .btn-reduce").click(function(){
		    		//获得input值
		    		var y = $("#buy_num").val();
		    		//转整
		    		x = parseInt(y)-1;
		    		if(x>0){
		    		   $("#buy_num").val(x); 
		    		}
		    	});


		    	$("#add_to_cart").click(() => {
		    		$("#add_to_cart").attr("href","${project_name}/product/add_to_cart?productId=${product.id}&amount=" + $("#buy_num").val())
				})

				$("#buy_now").click(() => {
					$("#add_to_cart").attr("href","${project_name}/product/add_to_cart?productId=${product.id}&amount=" + $("#buy_num").val())
				})
		    });
		</script>
	</head>
	<body>
		<jsp:include page="public_header.jsp"></jsp:include>
		<!--头部end-->
		<div class="w1200">
			<!--分类导航-->
			<div class="con_content">
				<!--提交区域-->
				<div class="con_top">
					<div class="con_top_l">
						<div class="tab-w">
							<div class="divw">
								<a href="">
									<span class="zoomPad">
	    								<img src="${project_name}/image/${product.image}"/>
	    							</span>
								</a>
							</div>
							<!--tab,ajax-->
						</div>
					</div>
					<div class="con_top_r">
						<div class="detail_top">
							<h1 class="detail_tit">${product.name}</h1>
							<div class="price_wrap">
								<div class="detail_price">
									<span class="price_now">
	    								<b class="em_sign">￥</b>
	    								${product.price}
	    							</span>
								</div>
								<div class="d_bh">商品编号：${product.id}</div>
							</div>
							<div class="detail_freight">
								<span class="pop_tit ">运费：</span>
								<span id="freight" class="pop_black">包邮</span>
							</div>
							<div class="detail_color">
								<div class="model_wrap count_wrap">
									<span class="pop_tit">数量：</span>
									<div class="wrap_input">
										<a href="javascript://" data-param="0" class="btn-add">-</a>
										<a href="javascript://" data-param="0" class="btn-reduce">+</a>
										<input value="1" id="buy_num" class="text" onkeyup="this.value=this.value.replace(/\D/g, '');">
									</div>
								</div>
								<div class="model_wrap">
									<div class="model_submilt">
										<div class="btn_goods_remind" style="display: inline-block;background: ffeded;border: 1px solid #FF0036">
											<a id="buy_now" href="submit.jsp" style="color:#FF0036">立即购买</a>
										</div>
										<div class="btn_goods_remind" style="display: inline-block;background: #ff0036;border-color: #ff0036">
											<a id="add_to_cart" href="${project_name}/product/add_to_cart?productId=${product.id}" style="color: white;">加入购物车</a>
										</div>
									</div>
									<div class="detail_ewm">
										<p class="ewm_bg_img"></p>
										<p>
											<span class="fs_14">微信 支付宝</span>
											<span class="fs_14">直播商品订购减 20 元</span>
										</p>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<!--提交区域end-->
				<!--展示区域-->
				<div class="con_tab">
					<div class="con_nav">
						<div class="con_nav_c">
							<div class="w1200">
								<ul>
									<li class="on "><a href="javascript:;">商品详情</a></li>
								</ul>
								<div class="fix_add_car">
									<div class="db_price">
										<em>¥</em>${product.price}
									</div>
									<a class="fixed_add_car" href="javascript:;">加入购物车</a>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="display">
					<div class="premeter_box">
						<div class="detail_lists">
							<div class="detail_con_l">
								<ul>
									<li>
										<div class="d_l_con1_l">
											${product.details}
										</div>
									</li>
								</ul>
							</div>
						</div>
					</div>
	    		<!--展示区域end-->
	    	</div>
	    </div>
	    <!--底部公用-->
	    <div class="footer">
	    	<div class="footer_b w1200"><img src="${project_name}/image/foot_img1.jpg"/></div>
	    	<div class="footer_help w1200">
	    		<div class="footer1_l">
	    			<dl class="helpDl">
	    				<dt><h5>使用帮助</h5></dt>
	    				<dd><a href="">税费收取规则 </a></dd>
	    				<dd><a href="">新手指南 </a></dd>
	    			    <dd><a href="">常见问题 </a></dd>
	    				<dd><a href="">用户协议 </a></dd>
	    			</dl>
	    			<dl class="helpDl">
	    				<dt><h5>会员服务</h5></dt>
	    				<dd><a href="">积分政策  </a></dd>
	    				<dd><a href="">会员权益  </a></dd>
	    			    <dd><a href="">会员等级  </a></dd>
	    			</dl>
	    			<dl class="helpDl">
	    				<dt><h5>支付方式</h5></dt>
	    				<dd><a href="">积分支付  </a></dd>
	    				<dd><a href="">货到付款  </a></dd>
	    			    <dd><a href="">在线支付  </a></dd>
	    				<dd><a href="">优惠券支付  </a></dd>
	    			</dl>
	    			<dl class="helpDl">
	    				<dt><h5>配送方式</h5></dt>
	    				<dd><a href="">包邮政策   </a></dd>
	    				<dd><a href="">费用说明   </a></dd>
	    			    <dd><a href="">配送说明   </a></dd>
	    			</dl>
	    			<dl class="helpDl">
	    				<dt><h5>售后服务</h5></dt>
	    				<dd><a href="">电子发票   </a></dd>
	    				<dd><a href="">售后咨询   </a></dd>
	    			    <dd><a href="">退货办理   </a></dd>
	    				<dd><a href="">退货政策   </a></dd>
	    			</dl>
	    		</div>
	    		<div class="footer1_r">
	    			<ul>
	    				<li>
	    					<h2>手机开心买</h2>
	    					<img src="${project_name}/image/footer_ewm_01.png"/>
	    					<p>下载移动客户端</p>
	    				</li>
	    				<li>
	    					<h2>开心买微信</h2>
	    					<img src="${project_name}/image/footer_ewm_02.png"/>
                            <p>开心买官方微信</p>
	    				</li>
	    			</ul>
	    		</div>
	    	</div>
	        <div class="footer_nav">
	        	<div class="w720">
	        		<ul>
	        			<li>
	        				<a href="">关于开心买 </a>
	        				<span class="line"></span>
	        			</li>
	        			<li>
	        				<a href="">投资者关系 </a>
	        				<span class="line"></span>
	        			</li>
	        			<li>
	        				<a href="">商家入驻  </a>
	        				<span class="line"></span>
	        			</li>
	        			<li>
	        				<a href="">联系我们 </a>
	        				<span class="line"></span>
	        			</li>
	        		</ul>
	        	</div>
	        </div>
	        <div class="footer_bottom">
	        	<div class="w1200">
	        		<p>
	        			<span class="font_arial">Copyright© 2006-2016 happigo. All Rights Reserved </span>
                                           免费服务热线: 400-705-1111 | 固话也可拨打: 800-705-1111
                        <span class="font_arial">E-Mail: service@happigo.com</span><br>
                                           湘ICP备12000157号 信息网络传播视听节目许可证号：1810530
	        		</p>
	        		<p class="footer_b">
	        			<a href="http://www.itrust.org.cn/home/index/itrust_certifi/wm/2782875193.jsp">
	        				<img src="${project_name}/image/foot_img3.png"/>
	        			</a>
	        			<a href="https://search.szfw.org/cert/l/CX20150428007576007720">
	        				<img src="${project_name}/image/foot_img4.png"/>
	        			</a>
	        		</p>
	        	</div>
	        </div>
	    </div>
	</body>
</html>